﻿using System.Linq;

namespace JinYuan.Helper
{
    public static class ConvertHelper
    {
        /// <summary>
        /// 字节数组高低位转换
        /// </summary>
        /// <param name="Arrbyte"></param>
        /// <returns></returns>
        public static byte[] ByteReverse(this byte[] Arrbyte)
        {
            byte[] ArrByte = Arrbyte.Select((x, i) => new { x, i }).GroupBy(x => x.i / 2).SelectMany(x => new byte[] { x.Last().x, x.First().x }).ToArray();
            return ArrByte;
        }
    }
}
